import { ReactNode } from "react";
import Taro from '@tarojs/taro'
import { getPageInfo } from "@/path/acrossAPI";
/**锚点ID */
export const generalAnchorId = "onRenderGeneralAnchorId"
/**注入公共组件 */
export function renderGeneralModal(p: { nodeId: string, node: ReactNode, nowPageID: string }) {
  const _pageId = p.nowPageID || getPageInfo().routeID
  setTimeout(() => {
    Taro.eventCenter.trigger(generalAnchorId + _pageId, { nowPageID: _pageId, node: p.node, nodeId: p.nodeId })
  }, 10);
}